#ifndef ROLEBEAN_H
#define ROLEBEAN_H
#include "QString"
#include "QList"
#include "QJsonArray"
#include "QJsonParseError"
#include "QJsonObject"
#include "QJsonArray"
#include "QList"
#include "citynode.h"
#include "utils/citymanager.h"
#include "runshopbean.h"
#include "kuozhangbean.h"
#include "zhongzhibean.h"

class RoleBean
{
public:
    QString account; //游戏帐号
    QString password; //游戏密码

    int roleIndex = 1; //角色索引

    RunShopBean *runshopBean = nullptr;
    KuoZhangBean *kuozhang = nullptr;
    ZhongZhiBean *zhongzhi = nullptr;
private:
    static void createObject(QJsonObject &obj, RoleBean role);

public:
    RoleBean();

    ~RoleBean();

    RoleBean(QString account, QString password, int roleIndex);

    static QList<RoleBean> jsonToArray(QByteArray jsonArray);

    static QByteArray ArraytoJson(QList<RoleBean*> *roleBeans);


};

#endif // ROLEBEAN_H
